#pragma once
#include "wOHandle.hpp"
#include "wProEdge.hpp"
#include "wProSurface.hpp"

namespace witotk{

	class wProContour:public wOHandle<ProContour>
	{
	public:
		wProContour(ProContour suf):wOHandle<ProContour>(suf)
		{
		}

		wProEdgeCollection_ptr GetEdges(ProSurface suf) 
		{
			typedef std::vector<ProEdge> ProEdges_T;
			struct VisitAction
			{
				static  ProError ProContourEdgeVisitAction ( ProEdge p_edge,
					ProError /*status*/,
					ProAppData app_data)
				{
					ProEdges_T * ct = (ProEdges_T*)app_data;
					ct->push_back(p_edge);
					return PRO_TK_NO_ERROR;
				}
			};
			ProEdges_T Edgess;
			 ProError error =ProContourEdgeVisit   ( suf,m_data,
				VisitAction::ProContourEdgeVisitAction,NULL,
				(ProAppData   )&Edgess);
			 if(error != PRO_TK_NO_ERROR )
			 {
				 return wProEdgeCollection_ptr();
			 }	
			 else
			 {
				 return wProEdgeCollection_ptr(new wProEdgeCollection(Edgess));
			 }

		}

	};
	typedef	std::tr1::shared_ptr<wProContour> wProContour_ptr;


	typedef	wCollectionshared_ptr<wCollection<wProContour>> wProContourCollection_ptr;

	typedef	wCollection<wProContour> wProContourCollection;

}